<template>
	<view class="box">
		<view class="flex bg-white justify-between margin-bottom-sm">
			<view class="bidding-left">
				<view class="nickname">{{detail.userName}}</view>
				<view class="phone">电话:{{detail.userMobile}}</view>
			</view>
			<view class="price">投标价:{{detail.competitivePrice}}</view>
		</view>
		<view class="flex bg-white justify-between margin-bottom-sm">
			<view class="bidding-left flex align-center justify-center">
				<view class="nickname" style="margin-bottom: 0;">
					<image style="width: 66rpx;height: 89rpx;" :src="baseUrl + '/static/excel-icon.png'"></image>
				</view>
				<view class="fujian">附件</view>
			</view>
			<view class="price">
				<view class="flex justify-center align-center flex-direction">
					<image style="width: 37rpx;height: 33rpx;" :src="baseUrl + '/static/read.png'"></image>
					<view class="type">阅读</view>
				</view>
				<view class="flex justify-center align-center flex-direction"  @click="saveImage" style="margin-left: 75rpx;">
					<image style="width: 37rpx;height: 33rpx;" :src="baseUrl + '/static/download.png'"></image>
					<view class="type" >下载</view>
				</view>
			</view>
		</view>
		<view class="describle bg-white  margin-bottom-sm">
			<view class="title">方案描述</view>
		       <view class="content">
				{{detail.content}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				baseUrl: this.$config.baseUrl,
				detail:{}
			}
		},
		onLoad(option) {
			if(option.item){
				this.detail = JSON.parse(option.item)
			}
		},
		methods: {
			toPage(url) {
				this.$util.openNewPage(url)

			},
			saveImage() {
				let url = this.detail.appendix
				let that = this
				uni.showModal({
				    title: '提示',
				    content: '如需下载请点击确定复制链接去浏览器中下载',
				    success: function (res) {
				        if (res.confirm) {
							uni.setClipboardData({
							    data: 'https://super.zoyob.com/mall-util/download/url?netAddress=' + url,
							    success: function () {
									that.getupdate()
							        // console.log('success');
							    }
							});
				        } else if (res.cancel) {
				            console.log('用户点击取消');
				        }
				    }
				});
				
				
				
				
				
				
				
				
				
				
			// 	uni.downloadFile({
			// 		url: url, //仅为示例，并非真实的资源
			// 		success: (res) => {
			// 			if (res.statusCode === 200) {
			// 				uni.saveFile({
			// 					tempFilePath: res.tempFilePath,
			// 					success: function(res) {
			// 						var savedFilePath = res.savedFilePath;
			// 						uni.openDocument({
			// 							filePath: res.savedFilePath,
			// 							success: (res) => console.log('成功打开文档'),
			// 							fail() {
			// 								that.$util.msg('请下载相关文件应用')
			// 							}
			// 						})
			// 						// console.log('保存成功' + savedFilePath);
			// 					}
			// 				});
			
			// 			}
			// 		}
			// 	})
			},
			}
	}
</script>

<style scoped>
	.box {
		padding: 20px;
	}

	.bidding-left {
		padding: 40rpx;

	}

	.nickname {
		margin-bottom: 29rpx;
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #181818;
	}

	.phone {
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #999999;
		
	}

	.price {
		display: flex;
		justify-content: center;
		align-items: center;
		padding-right: 42rpx;
	}

	.type {
		margin-top: 16rpx;
		font-size: 20rpx;
		color: #999999;
	}
	.describle{
		padding: 31rpx 29rpx 37rpx 50rpx;
	}
	.title{
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-bottom: 39rpx;
	}
		
	.pro-title{
		margin-bottom: 60rpx;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #666666;
	}
		
	.content{
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #666666;
	}
	.fujian{
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-left: 53rpx;
	}
</style>
